package com.sdy.supermarket.biz.utils;

import com.sdy.common.model.FileObj;
import com.sdy.common.utils.StringUtil;
import com.sdy.fs.api.FsApi;

/**
 * @author zhouziqiang 
 */
public class FileUtil {
    public static void updateFileInfo(FileObj f, FsApi fsApi) {
        if (StringUtil.isBlank(f.getPath()) && StringUtil.isBlank(f.getFileName()) && StringUtil.isNotBlank(f.getId())) {
            FileObj fileInfo = fsApi.getFileInfo(f.getId());
            if (fileInfo != null) {
                f.setFileName(fileInfo.getFileName());
                f.setPath(fileInfo.getPath());
            }
        }
    }
}
